import axios from 'axios'
axios.defaults.baseURL = 'http://lovegf.cn:8899';

export  const  getLunbotu=()=>{
    return axios.get("/api/getlunbo");
}

export  const  newslist=()=>{
    return axios.get("/api/getnewslist");
};


// export  const  getnewinfo=(params)=>{
//     return axios.get(`/api/getnew/${params.aa}`);
// };

export  const  getnewinfo=(params)=>{
    return axios.get(`/api/getnew/${params}`);
};

export const  getcomments=function(params){ //{id:2,pageindex:1}
    return axios.get(`/api/getcomments/${params.id}?pageindex=${params.pageindex}`);
};


export const  postcomment=function(params){ //{id:2,content:"****"}
    return axios.post(`/api/postcomment/${params.id}`,{content:params.content});
};

export const  cate=(params)=>{ //{id:2,pageindex:1}
    return axios.get(`/api/getimgcategory`);
};


export const  getimages=(params)=>{ //{id:2,pageindex:1}
    return axios.get(`/api/getimages/${params}`);
};

export const  getimageInfo=(params)=>{ //{id:2,pageindex:1}
    return axios.get(`/api/getimageInfo/${params}`);
};


/* 缩略图 */
export const  getThumImages= params => {
    return axios.get(`/api/getthumimages/${params}`)
};

/* 商品列表 */
export const  goodsList= params => {
    return axios.get('/api/getgoods?pageindex='+params).then(res=>res)
};

/* 商品轮播图 */
export const  getlunbotu= params => {
    return axios.get(`/api/getthumimages/${params}`).then(res=>res)
};


/*根据id获取 商品详情 */
export const  getGoodsInfo= params => {
    return axios.get(`/api/goods/getinfo/${params}`).then(res=>res)
};

/*根据id获取 商品图文 */
export const  goodsDesc= params => {
    return axios.get(`/api/goods/getdesc/${params}`).then(res=>res)
};

/* 获取购物车列表数据 */
export const  getGoodsList= params => {
    return axios.get(`/api/goods/getshopcarlist/${params}`).then(res=>res)
};












